<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>易风课堂-课程列表</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <header class="navbar-dark yf-navbar fixed-top">
        <div class="container">
            <nav class="navbar navbar-expand-lg">
                <a class="navbar-brand" href="/">易风课堂（LOGO）</a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                  <span class="navbar-toggler-icon"></span>
                </button>
              
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                  <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                      <a class="nav-link" href="index.html">网站首页 <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item active">
                      <a class="nav-link" href="list.html">课程列表</a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link" href="linkus.html">联系我们</a>
                    </li>
                  </ul>
                  <div class="my-2 my-lg-0">
                    <a class="btn btn-light my-2 my-sm-0" type="登录">登录</a>
                    <a class="btn btn-danger my-2 my-sm-0" type="注册">注册</a>
                  </div>
                </div>
              </nav>
        </div>
    </header>
    <div class="banner mt-0">
        <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
              <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
              <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
            </ol>
            <div class="carousel-inner">
              <div class="carousel-item active">
                <img src="images/banner1.jpg" class="d-block w-100" alt="...">
              </div>
              <div class="carousel-item">
                <img src="images/banner2.jpg" class="d-block w-100" alt="...">
              </div>
            </div>
            <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
              <span class="carousel-control-prev-icon" aria-hidden="true"></span>
              <span class="sr-only">Previous</span>
            </a>
            <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
              <span class="carousel-control-next-icon" aria-hidden="true"></span>
              <span class="sr-only">Next</span>
            </a>
          </div>
    </div>
    <div class="main news">
      <div class="container title mt-5 mb-5"><h3>最新课程</h3></div>
        <div class="container list">
            <div class="row items">
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/1.png" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">ThinkPHP6.0+UniAPP项目实战(ThinkPHP开发APP接口)</div>
                        <div class="desc">
                            课程还是采用小项目，多知识点的方式，让大家快速掌握ThinkPHP的高级应用，以及API接口的开发。
                        </div>
                    </div>
                </div>
                <!-- end list -->
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/2.jpg" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">Laravel5.8入门实战-安全与优化（快速开发安全实用的企业网站）</div>
                        <div class="desc">
                            课程使用Laravel目前最新版本（5.8）来开发一个企业网站项目。主要以快速Laravel入门为主
                        </div>
                    </div>
                </div>
                <!-- end list -->
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/3.jpg" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">ThinkPHP5.0博客系统开发实战-后台功能的插件化管理-php邮件验证</div>
                        <div class="desc">
                            ThinkPHP5.0博客系统开发实战-后台功能的插件化管理-php邮件验证。希望大家要从中掌握新的
                        </div>
                    </div>
                </div>
                <!-- end list -->
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/4.jpg" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">Thinkphp5双语企业站开发实战+会员+微信模块</div>
                        <div class="desc">
                            课程内容摘要： 双语网站，管理员模块，内容管理模块，banner管理模块，文件管理模块
                        </div>
                    </div>
                </div>
                <!-- end list -->
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/5.jpg" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">PHPExcel快速入门之thinkphp5.0 员工业绩报表实战-php操作excel</div>
                        <div class="desc">
                            掌握PHP操作Excel，熟练使用phpexcel类，通过thinkphp5.0开发员工业开发员工业开发员工业
                        </div>
                    </div>
                </div>
                <!-- end list -->
                <!-- start list -->
                <div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="images/6.jpg" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">零基础 Linux 服务器VPS web服务器环境部署+shell脚本 服务器</div>
                        <div class="desc">
                            本教程属于零基础快速入门课程，所以您不需要担必不懂linux系统开发员工业开发员工业
                        </div>
                    </div>
                </div>
                <!-- end list -->
            </div>
        </div>
        <div class="text-center">
          <button class="btn btn-danger mt-3 mb-3" id="loaddata">加载更多</button>
        </div>
    </div>
    <!-- start footer -->
    <div class="text-center footer">
        <p>合作邮箱：576617109@qq.com 咨询QQ：576617109</p>
        <p> ©2017-2018 易风课堂 All Rights Reserved. 豫ICP备000000号-1 版权所有：易风课堂</p>
    </div>
    <!-- end footer -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script>
  function createItem(pic='',title='',desc=''){
    return `<div class="col-6 col-sm-6 col-md-4 col-lg-3 mb-4 item">
                    <div class="box">
                        <div class="img"><img src="${pic}" class="img-fluid" alt="" srcset=""></div>
                        <div class="mt-2 title">${title}</div>
                        <div class="desc">
                          ${desc}
                        </div>
                    </div>
                </div>`;
  }

  $("#loaddata").on('click',function(){
    var myRequest = new Request('./js/data.json');
    fetch('./js/data.json',{method:"GET"})
    .then(response => response.json())
    .then(data=>{
      console.log(data);
      var str="";
      data.list.forEach((value, index, array) => {
        str = createItem(value.pic,value.title,value.desc);
          $(".items").append(str);
        })
    });
  });

  // $("#loaddata").on('click',function(){
  //   console.log(1);
  //   $.ajax({
  //     url:'/js/data.json',
  //     type:'get',
  //     success:function(res){
  //       console.log(res);
  //     }
  //   })
  // });
</script>
</body>
</html>